{{- if .HasShortcode "mermaid" }}
<script src='{{ absURL "js/mermaid.min.js" }}' integrity="sha384-ouEDSZX7s11mVnXBtoR5H5qrVaBG2eK2fcIuH5co6DOpjLoI2ElL/OzAn61u1Yvo" crossorigin="anonymous"></script>
<script>
  const needMermaid = Boolean(window.mermaid) && Boolean(document.getElementsByClassName('mermaid'))
  if (needMermaid) {
    mermaid.initialize({startOnLoad: true, theme: 'neutral'})
  }
</script>
{{- end }}